home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hottest 6
/
Hottest 6 (1996)(PDSoft)[!].iso
/
software
/
fredfish
/
1041.lha
/
Programs
/
Data2Object
/
d2o.doc
< prev
next >
Wrap
Text File
|
1994-02-20
|
4KB
|
155 lines
NAME
d2o (Short for Data2Object) $VER: 1.3 (18.2.94)
SYNOPSIS
This program makes an object file out of a text file. It's a 2.04 and
up only program.
FUNCTION
Sometimes you want to have a large text file into your code. For
example a built-in helpfile. d2o gives an easy way to do just that.
It takes the textfile as an argument an produces a standard object
file.
An example for in a makefile:
-----------------------------------------------
OBJ = aMain.o aTextHelp.o
Prog: $(OBJ)
slink WITH prog.lnk
aTextHelp.o: Prog.Help
d2o Prog.Help SYMBOL TextHelp OBJECT aTextHelp.o
c.o.:
sc $*
-----------------------------------------------
So when you change the helpfile Prog.Help, the object file will be
automaticly created. The helpfile is accessible through the symbols
pTextHelp and lTextHelpLen. pTextHelp is a text array (TEXT) off the
helpfile. lTextHelpLen is a LONG and gives the length of the helpfile.
Don't forget to take the following two lines into your program:
extern LONG lTextHelpLen;
extern TEXT pTextHelp[];
Of course, the name of the variables depends on the name you give to
them with the SYMBOL option.
INPUTS
d2o FILE/A,CHIP/S,FAST/S,SYMBOL/K,OBJECT/K
CHIP
With the CHIP switch the data will be loaded into chip ram. This is
nescesary for graphics and sound data.
FAST
With the FAST switch the data will be loaded into fast ram. Be
carefull when you use this option, because not all computers have fast
ram.
SYMBOL
The symbol name is the base name of the generated symbols pText and
pTextLen. The default basename is 'Text' and gives the two symbol
names 'pText' and 'lTextLen', but it can also be 'Help'. This gives
the two symbol names pHelp and lHelpLen.
OBJECT
If no object name is given, it wil get the default object name
'Text.o'. If you specify a name there will be no '.o' appended to it.
RESULTS
An object file with the following symbols:
TEXT pText[]; /* Pointer to the text */
LONG lTextLen; /* Length of the textfile */
d2o returns 0 when succesfull and 10 in case of an error.
NOTES
When the CHIP and the FAST option both are specified the memory type
is the default MEMF_ANY.
It is only tested with slink from SAS, but it should work with other
linkers to.
d2o takes any file as an input file and stores it in one large chunk
of code. So you could also use it for graphic data or any other file.
However, this is not tested so be warned if it doesn't work.
ADDRESS
Matthijs Luger
Internet: mluger@bio.vu.nl
Fidonet: 2:280/509.4
2:280/303.4
RELEASE
v1.0 (29.9.93) 9096 bytes
-------------------------
o Initial release.
v1.1 (1.11.93) 9208 bytes
-------------------------
o Added -c option so data will be loaded into CHIP_RAM.
o Updated the manual and changed the reference off STRPTR to TEXT.
v1.2 (23.22.93) 9208 bytes
--------------------------
o There were some typo's in the manual.
v1.3 (18.2.94) 2076 bytes
-------------------------
o Added ReadArgs() for argument parsing. From now on d2o is a
2.04+ only program.
o Added FAST switch.
o Added return codes when something goes wrong. d2o returns 10 in
case of any error. (file not found, wrong arguments, not enough
memory or no arguments)
o Optimized some routines, removed sprintf() function, removed
startup module and recompiled with other switches. The
executable is now four times smaller then v1.2.
o Added examples in assembler and C.